<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!--<meta http-equiv="Content-Security-Policy" content="default-src *;img-src 'self' data: base64; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>-->
    <title></title>
    <link rel="shortcut icon" href=./favicon.ico type=image/x-icon>
    <link rel="stylesheet" href="static/css/public.css" type="text/css">
	<link rel="stylesheet" type="text/css" href="./static/translateelement.css"/>
	<script src="./static/f.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		 function googleTranslateElementInit(){
				let data = 	new google.translate.TranslateElement(
				{
			            //pageLanguage: 'zh-CN',
			        //这个是你需要翻译的语言，比如你只需要翻译成越南和英语，这里就只写en,vi
					includedLanguages: 'zh-CN,en',
					layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
					autoDisplay: false,
				},
				'google_translate_element'//触发按钮的id
			);
			window.language = data.c
		}
	</script>
	<!-- <script src="https://translate.google.cn/translate_a/element.js?cb=googleTranslateElementInit"></script> -->
    <script type="text/javascript">
      // 步骤一:创建异步对象
      var ajax = new XMLHttpRequest();
      // 步骤二:设置请求的url参数,参数一是请求的类型,参数二是请求的url,可以带参数,动态的传递参数starName到服务端
      ajax.open('get', 'http://www.newstarryxyz.online/api/site/getInfo.do');
      // ajax.open('get', 'http://localhost:8070/api/site/getInfo.do');
      // 步骤三:发送请求
      ajax.send();
      // 步骤四:注册事件 onreadystatechange 状态改变就会调用
      ajax.onreadystatechange = function () {
        if (ajax.readyState == 4 && ajax.status == 200) {
          // 步骤五 如果能够进到这个判断 说明 数据 完美的回来了,并且请求的页面是存在的
          var styleName = JSON.parse(ajax.responseText).data.siteColor
          if (styleName == 'black') {
            window.localStorage.setItem('styleName', 'black-bg')
            document.getElementsByTagName('body')[0].className = 'black-bg'
          } else if (styleName == 'yellow') {
            window.localStorage.setItem('styleName', 'red-bg')
            document.getElementsByTagName('body')[0].className = 'yellow-bg'
          } else {
            window.localStorage.setItem('styleName', 'red-bg')
            document.getElementsByTagName('body')[0].className = 'red-bg'
          }
        }
      }
    </script>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>

</html>
<script type="text/javascript">




</script>

